export default {
    uploadFile : function(form){
        var iframe = document.createElement("iframe");
        iframe.width = 0;
        iframe.height = 0;
        iframe.border = 0;
        iframe.name = 'file-iframe';
        iframe.id = 'file-iframe';
        iframe.setAttribute('style',"width:0;height:0;border:none");

        document.body.appendChild(iframe);

        iframe.onload = function () {
            setTimeout(function(){
                var _iframe = document.getElementById('file-iframe');
                _iframe.parentNode.removeChild(_iframe);
            })
            form.submit();
        }
    },
    placeholderSupport:function(){
        return "placeholder" in document.createElement('input');
    },
    animate:window.requestAnimFrame = (function() {  
            return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||  
                function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {  
                    return window.setTimeout(callback, 1000 / 60);  
                };  
    })(),  
}